//
//  CustomNavViewController.m
//  AntsExpress
//
//  Created by slccper on 16/1/1.
//  Copyright © 2016年 slccper. All rights reserved.
//
#import "CustomNavViewController.h"
@interface CustomNavViewController ()

@end

@implementation CustomNavViewController
@synthesize isBack;
- (void)viewDidLoad {
    [super viewDidLoad];
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0f) {
        self.edgesForExtendedLayout = UIRectEdgeNone;
        self.extendedLayoutIncludesOpaqueBars = NO;
        self.modalPresentationCapturesStatusBarAppearance = NO;
        self.automaticallyAdjustsScrollViewInsets = NO;
        self.navigationController.navigationBar.translucent = NO;
        self.tabBarController.tabBar.translucent = NO;
    }
#endif
    self.view.backgroundColor=[UIColor whiteColor];
//    UIImageView *navigationBarImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"big4ads_banner02.png"]];
//    navigationBarImage.frame=CGRectMake(0, 0, ScreenWidth, TopBarHeight);
//    [navigationBarImage setUserInteractionEnabled:YES];
//    [self.view addSubview:navigationBarImage];
    if (isBack) {
        UIImageView * icon=[[UIImageView alloc] initWithFrame:CGRectMake(10.0, 5, 30, 30.0)];
        icon.image=[UIImage imageNamed:@"back.png"];
        
        UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom];
        button.frame = CGRectMake(0, 20, 50, 44);
//        [button setTitle:@"返回" forState:UIControlStateNormal];
//        [button setImage:[UIImage imageNamed:@"back.png"] forState:UIControlStateNormal];
        [button addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
        [button addSubview:icon];
        UIBarButtonItem *left = [[UIBarButtonItem alloc] initWithCustomView:button];
        [self.navigationItem setLeftBarButtonItem:left animated:YES];
    }
    if ([self respondsToSelector:@selector(getWebData)]) {
        [self getWebData];
    }
//    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"big4ads_banner02.png"] forBarMetrics:UIBarMetricsDefault];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(void)getAntsDataFail:(NSInteger)type
{
    [clsOtherFun hideLoadingView];
    [clsOtherFun ShowMsgWithNoData];
}
-(void)backAction
{
    [self.navigationController popViewControllerAnimated:YES];
}

@end
